import navToNext from '../../../wxjs/navToNext.js'
const app = getApp();

var data = {
  xhx_images: app.xhx_images,
  xhx_route: app.xhx_route,
  dialogValue:null,
  updatingStatus: false
};

var currentPage = {
  data,
  onLoad,
  getBalanceDetail,
  jump,
  updating,
};

var page = Object.assign({}, navToNext, currentPage);

Page(page);


function onLoad(options) {
  const that = this;
  that.getBalanceDetail();
}

function getBalanceDetail() {
  const that = this;
  app.middleware.requestAjax({
    serAddr: app.serAddrs.getBalanceDetail,
    data: {},
    cancelToast: true,
    success: function (res) {
      let temp = res.data;
      that.setData(temp)
      // console.log(that.data);
    },
    fail: function (res) {
      app.middleware.showToast(res && res.msg || "加载失败");
    }
  })
}

function jump(){
  var dialogValue = {
    showDialog: true,
    backgroundColor:'#2D2D2D', //背景颜色
    title: '提现金额最低为50元', //标题
    titleColor:'#fff',  //标题颜色
    content: '无法提现',  //主体内容
    contentColor:'#CECECE',
  
    confirmText: '确定',  //右边按钮文字
    confirmColor:'',  //右边按钮颜色
    // 右边按钮回调函数
    confirm: function (res) {
      // console.log('111111111111111')
    },
  }
  this.setData({
    dialogValue: dialogValue
  })
}

function updating() {
  this.setData({
    updatingStatus: !this.data.updatingStatus
  })
}

